import { createPinia } from 'pinia'
import piniaPluginPersist from 'pinia-plugin-persist'
const store = createPinia()
store.use(piniaPluginPersist)
store.use(({ store }) => {
  const initialState = JSON.parse(JSON.stringify(store.$state)); // 提前存起来，到时候批量改成原来的数据
  store.$reset = () => {
    store.$patch(initialState);
  }
})
export default store
